package com.power.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.power.model.jdao.IQuexianchaxunDao;
import com.power.model.mdao.QuexianchaxunMapper;
import com.power.model.pojo.Quexianchaxun;

@Service
public class QuexianchaxunService {
	@Autowired
	QuexianchaxunMapper mapper;
	@Autowired
	IQuexianchaxunDao dao;
	    //查询所有
	public List<Quexianchaxun> selectAll(int pagenum,int pagesize){
		PageHelper.startPage(pagenum, pagesize);
		return mapper.selectAll();
		
	}
	//新增
	public Integer addQuexianchaxun(Quexianchaxun quexian) {
		dao.save(quexian);
		return quexian.getFindid();//返回编号
		
		
	}
	//修改
	
	public boolean updateQuexianchaxun(Quexianchaxun quexian) {
		int id=quexian.getFindid();
		Quexianchaxun q=dao.findById(id).get();
		q.setFindid(quexian.getFindid());
		q.setFindUser(quexian.getFindUser());
		q.setGtid(quexian.getGtid());
		q.setQxtype(quexian.getQxtype());
		q.setQxmiaoshu(quexian.getQxmiaoshu());
		q.setQxtype(quexian.getQxtype());
		q.setRate(quexian.getRate());
		q.setRwid(quexian.getRwid());
		q.setXiaDate(quexian.getXiaDate());
		q.setXiauser(quexian.getXiauser());
		q.setXunjianrwid(quexian.getXunjianrwid());
		q.setFindtime(quexian.getFindtime());
		dao.save(quexian);
		return true;
		
	}

}
